package com.homework.test1;

public class Demo3 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        change(arr);
        System.out.println("交换完之后的数组为：");
        for (int i : arr) {
            System.out.print(i+" ");
        }
    }

    private static int[] change(int[] arr) {
        int temp = 0;
        temp= arr[1];
        arr[1] =  arr[3];
        arr[3] = temp;
        return arr;
    }
}
